<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <my-swiper items="[
    
    ]" />

    <script>
        class MySwiper extends HTMLElement {
            constructor() {
                super();
                const wrapper = document.createElement('div');
                wrapper.style = `border: 1px solid; width: 500px; height: 300px`

                const shadow = this.attachShadow({ mode: 'open' });
                shadow.appendChild(wrapper);
            }

        }

        //全局注册该元素
        customElements.define("my-swiper", MySwiper);


    </script>
</body>

</html>